<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<!--suppress HtmlRequiredTitleElement -->
<head>
    <th:block th:include="include :: header('通知公告表')"/>
    <style>
        body .tox-tinymce-aux {
            z-index: 19892000;
        }
    </style>
</head>
<body class="layui-layout-body theme-himio">
<!-- 正文开始 -->
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <!-- 表格工具栏 -->
            <form class="layui-form toolbar">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">公告标题:</label>
                        <div class="layui-input-inline">
                            <input name="noticeTitle" class="layui-input" placeholder="请输入公告标题"/>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">公告类型:</label>
                        <div class="layui-input-inline">
                            <select name="noticeType">
                                <option value="">全部</option>
                                <option value="1">通知</option>
                                <option value="2">公告</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">创建者:</label>
                        <div class="layui-input-inline">
                            <input name="createByName" class="layui-input" placeholder="请输入创建者"/>
                        </div>
                    </div>
                    <div class="layui-inline">&emsp;
                        <button class="layui-btn icon-btn" lay-filter="noticeTbSearch" lay-submit>
                            <i class="layui-icon layui-icon-search"></i>搜索
                        </button>
                    </div>
                </div>
            </form>
            <!-- 数据表格 -->
            <table id="noticeTable" lay-filter="noticeTable"></table>
        </div>
    </div>
</div>

<!--表格操作工具按钮-->
<script type="text/html" id="noticeTbBar">
    <a class="layui-btn layui-bg-blue layui-btn-sm icon-btn" lay-event="edit" shiro:hasPermission="system:notice:edit"><i class="fa fa-edit"></i>修改</a>
    <a class="layui-btn layui-btn-danger layui-btn-sm icon-btn" lay-event="del" shiro:hasPermission="system:notice:remove"><i class="fa fa-trash"></i>删除</a>
</script>


<!-- 表单弹窗 edit -->
<script type="text/html" id="noticeEditDialog">
    <form id="noticeEditForm" lay-filter="noticeEditForm" class="layui-form model-form">
        <input type="hidden" name="noticeId">
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">公告标题:</label>
            <div class="layui-input-block">
                <input type="text" name="noticeTitle" placeholder="请输入公告标题" class="layui-input" lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">公告类型:</label>
            <div class="layui-input-block">
                <label>
                    <select name="noticeType" lay-verify="required" lay-vertype="tips">
                        <option value="1">通知</option>
                        <option value="2">公告</option>
                    </select>
                </label>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">公告内容:</label>
            <div class="layui-input-block">
                <label>
                    <textarea id="noticeContentEditor" name="noticeContent"></textarea>
                </label>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">公告状态:</label>
            <div class="layui-input-block">
                <input type="radio" th:each="dict : ${@dict.getType('sys_normal_disable')}" th:id="${dict.dictCode}"
                       name="status" th:value="${dict.dictValue}" th:title="${dict.dictLabel}" th:checked="${dict.default}"/>
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn" lay-filter="noticeEditSubmit" lay-submit>保存</button>
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
        </div>
    </form>
</script>


<!-- js部分 -->
<th:block th:include="include :: footer"/>
<th:block th:include="include :: tinymceJs"/>
<script th:inline="javascript">
    var addFlag = [[${@permission.hasPermit('system:notice:add')}]];
    var editFlag = [[${@permission.hasPermit('system:notice:edit')}]];
    var removeFlag = [[${@permission.hasPermit('system:notice:remove')}]];
    var exportFlag = [[${@permission.hasPermit('system:notice:export')}]];
    var dictSysNoticeType = [[${@dict.getType('sys_notice_type')}]];
    var prefix = ctx + "system/notice";
</script>
<script th:src="@{/static/assets/system/js/notice.js}"></script>
</body>
</html>

